package org.example.test.blackIP;

import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.11.0)",
    comments = "Source: black_ip.proto")
public final class BlackIpApiGrpc {

  private BlackIpApiGrpc() {}

  public static final String SERVICE_NAME = "org.example.test.blackIP.BlackIpApi";

  // Static method descriptors that strictly reflect the proto.
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  @java.lang.Deprecated // Use {@link #getCheckBlackIpValidMethod()} instead. 
  public static final io.grpc.MethodDescriptor<org.example.test.blackIP.IpQuery,
      org.example.test.blackIP.CodeQuery> METHOD_CHECK_BLACK_IP_VALID = getCheckBlackIpValidMethodHelper();

  private static volatile io.grpc.MethodDescriptor<org.example.test.blackIP.IpQuery,
      org.example.test.blackIP.CodeQuery> getCheckBlackIpValidMethod;

  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static io.grpc.MethodDescriptor<org.example.test.blackIP.IpQuery,
      org.example.test.blackIP.CodeQuery> getCheckBlackIpValidMethod() {
    return getCheckBlackIpValidMethodHelper();
  }

  private static io.grpc.MethodDescriptor<org.example.test.blackIP.IpQuery,
      org.example.test.blackIP.CodeQuery> getCheckBlackIpValidMethodHelper() {
    io.grpc.MethodDescriptor<org.example.test.blackIP.IpQuery, org.example.test.blackIP.CodeQuery> getCheckBlackIpValidMethod;
    if ((getCheckBlackIpValidMethod = BlackIpApiGrpc.getCheckBlackIpValidMethod) == null) {
      synchronized (BlackIpApiGrpc.class) {
        if ((getCheckBlackIpValidMethod = BlackIpApiGrpc.getCheckBlackIpValidMethod) == null) {
          BlackIpApiGrpc.getCheckBlackIpValidMethod = getCheckBlackIpValidMethod = 
              io.grpc.MethodDescriptor.<org.example.test.blackIP.IpQuery, org.example.test.blackIP.CodeQuery>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(
                  "org.example.test.blackIP.BlackIpApi", "CheckBlackIpValid"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  org.example.test.blackIP.IpQuery.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  org.example.test.blackIP.CodeQuery.getDefaultInstance()))
                  .setSchemaDescriptor(new BlackIpApiMethodDescriptorSupplier("CheckBlackIpValid"))
                  .build();
          }
        }
     }
     return getCheckBlackIpValidMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static BlackIpApiStub newStub(io.grpc.Channel channel) {
    return new BlackIpApiStub(channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static BlackIpApiBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    return new BlackIpApiBlockingStub(channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static BlackIpApiFutureStub newFutureStub(
      io.grpc.Channel channel) {
    return new BlackIpApiFutureStub(channel);
  }

  /**
   */
  public static abstract class BlackIpApiImplBase implements io.grpc.BindableService {

    /**
     */
    public void checkBlackIpValid(org.example.test.blackIP.IpQuery request,
        io.grpc.stub.StreamObserver<org.example.test.blackIP.CodeQuery> responseObserver) {
      asyncUnimplementedUnaryCall(getCheckBlackIpValidMethodHelper(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getCheckBlackIpValidMethodHelper(),
            asyncUnaryCall(
              new MethodHandlers<
                org.example.test.blackIP.IpQuery,
                org.example.test.blackIP.CodeQuery>(
                  this, METHODID_CHECK_BLACK_IP_VALID)))
          .build();
    }
  }

  /**
   */
  public static final class BlackIpApiStub extends io.grpc.stub.AbstractStub<BlackIpApiStub> {
    private BlackIpApiStub(io.grpc.Channel channel) {
      super(channel);
    }

    private BlackIpApiStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected BlackIpApiStub build(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      return new BlackIpApiStub(channel, callOptions);
    }

    /**
     */
    public void checkBlackIpValid(org.example.test.blackIP.IpQuery request,
        io.grpc.stub.StreamObserver<org.example.test.blackIP.CodeQuery> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(getCheckBlackIpValidMethodHelper(), getCallOptions()), request, responseObserver);
    }
  }

  /**
   */
  public static final class BlackIpApiBlockingStub extends io.grpc.stub.AbstractStub<BlackIpApiBlockingStub> {
    private BlackIpApiBlockingStub(io.grpc.Channel channel) {
      super(channel);
    }

    private BlackIpApiBlockingStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected BlackIpApiBlockingStub build(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      return new BlackIpApiBlockingStub(channel, callOptions);
    }

    /**
     */
    public org.example.test.blackIP.CodeQuery checkBlackIpValid(org.example.test.blackIP.IpQuery request) {
      return blockingUnaryCall(
          getChannel(), getCheckBlackIpValidMethodHelper(), getCallOptions(), request);
    }
  }

  /**
   */
  public static final class BlackIpApiFutureStub extends io.grpc.stub.AbstractStub<BlackIpApiFutureStub> {
    private BlackIpApiFutureStub(io.grpc.Channel channel) {
      super(channel);
    }

    private BlackIpApiFutureStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected BlackIpApiFutureStub build(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      return new BlackIpApiFutureStub(channel, callOptions);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture<org.example.test.blackIP.CodeQuery> checkBlackIpValid(
        org.example.test.blackIP.IpQuery request) {
      return futureUnaryCall(
          getChannel().newCall(getCheckBlackIpValidMethodHelper(), getCallOptions()), request);
    }
  }

  private static final int METHODID_CHECK_BLACK_IP_VALID = 0;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final BlackIpApiImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(BlackIpApiImplBase serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_CHECK_BLACK_IP_VALID:
          serviceImpl.checkBlackIpValid((org.example.test.blackIP.IpQuery) request,
              (io.grpc.stub.StreamObserver<org.example.test.blackIP.CodeQuery>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }
  }

  private static abstract class BlackIpApiBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    BlackIpApiBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return org.example.test.blackIP.BlackIp.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("BlackIpApi");
    }
  }

  private static final class BlackIpApiFileDescriptorSupplier
      extends BlackIpApiBaseDescriptorSupplier {
    BlackIpApiFileDescriptorSupplier() {}
  }

  private static final class BlackIpApiMethodDescriptorSupplier
      extends BlackIpApiBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    BlackIpApiMethodDescriptorSupplier(String methodName) {
      this.methodName = methodName;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (BlackIpApiGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new BlackIpApiFileDescriptorSupplier())
              .addMethod(getCheckBlackIpValidMethodHelper())
              .build();
        }
      }
    }
    return result;
  }
}
